# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

list(APPEND CMAKE_FIND_ROOT_PATH ${QT_PREFIX})
include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)

find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)

add_library(flutterbridge SHARED
./include/FlutterBridgeQtSide.h
./include/FlutterBridgeJsSide.h
./src/FlutterBridgeQtSide.cpp
./src/FlutterBridgeJsSide.cpp
./src/FlutterBridge.cpp)

target_include_directories(flutterbridge PUBLIC ${NATIVERENDER_ROOT_PATH}/include)
target_link_libraries(flutterbridge PRIVATE Qt${QT_VERSION_MAJOR}::Core libace_napi.z.so)